<template>
  <div class="footer">
    <h1>Footer</h1>
    <p>count{{ count }}</p>
    <p>{{count}}</p>
    <h2>电影列表 <button @click="getMovieList">获取</button></h2>
    <ul>
      <li v-for="item in movieList" :key="item.tvId">{{ item.albumName }}</li>
    </ul>
  </div>
</template>

<script>
import { mapActions, mapState } from 'vuex';
export default {
  name: "Footer",
  computed:{
    //1.mapState的数组写法,直接把store的state的数据名称 作为计算属性的名称
    ...mapState('count',['count','movieList']),

    //2.mapState的对象写法,可以规定计算属性的名称
    ...mapState('count',{count1:'count',price1:'price'})
  },
  methods:{
    ...mapActions('count',['getMovieList']),
   /*  getMovieList(){
      this.$store.dispatch('getMovieList')
    } */
  }
};
</script>

<style>
.footer {
  margin: 30px;
  background: palevioletred;
}
</style>